/**
 * Created by Administrator on 2017/8/15.
 */
/**
 * Created by Administrator on 2017/8/10.
 * 要求：1、编写Person类，要求必须有name和age属性，并实现walk方法
 *       2、要求不同年龄的人的walk方法不同（提示：可以用输出语句表示walk方法，如;爬着走，拄着拐杖走）
 */
public class Person {
    public static int eyeNum = 2;       //类变量：对象都一致的
    private String name;
    private int age;                //成员变量:每个对象有差异的东西

    public static void main(String[] args) {
        YoungPeople zhangqi = new YoungPeople();
        zhangqi.setName("张琦");
        zhangqi.setAge(22);
        zhangqi.show();
        zhangqi.makefun();
        System.out.println();

        Children qq = new Children();
        qq.setName("qq");
        qq.setAge(2);
        qq.show();
        qq.makefun();
        System.out.println();

        OldMen yeye = new OldMen();
        yeye.setName("老王叔");
        yeye.setAge(68);
        yeye.show();
        //下面两条语句执行结果一样。
        OldMen.makefun();
        yeye.makefun();
    }

    public void walk() {
        if (age < 3) {
            System.out.println("行走方式：宝宝会爬着走！");
        } else if (age >= 3 && age <= 60) {
            System.out.println("行走方式：我能各种方式走，能爬，能跑，能游！");
        } else if (age > 60) {
            System.out.println("行走方式：我柱着拐杖走！");
        }
    }

    /* public String getName(){
         return this.name;
     }*/
    public void setName(String realname) {
        name = realname;
    }

    public void setAge(int realage) {
        age = realage;
    }

    public void show(){
        System.out.println("姓名:" + name);
        System.out.println("年龄:" + age);
        System.out.println("眼球数:" + eyeNum);
        this.walk();
    }
}